<UserControl x:Class="SkinningSample.View.Page2"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:SkinningSample.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
  <UserControl.Resources>
    
    <!-- Data template to display a single book. This shows how you can customise the appearance
    of items in lists. -->
    <DataTemplate DataType="{x:Type vm:BookViewModel}">
      <Grid Margin="5">
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="150"/>
        </Grid.ColumnDefinitions>
        
        <TextBlock Text="{Binding Title}" FontSize="14" TextTrimming="CharacterEllipsis"/>
        <TextBlock Grid.Row="1" Text="{Binding Author}" FontSize="12" TextTrimming="CharacterEllipsis"/>
        <TextBlock Grid.Column="1" Text="{Binding Publisher}" FontSize="12" TextTrimming="CharacterEllipsis"/>
        <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding ISBN}" FontSize="12"/>
        
      </Grid>
    </DataTemplate>
    
  </UserControl.Resources>
  
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!-- Top toolbar -->
    <Border Grid.Row="0" Style="{DynamicResource ToolbarBorderStyle}">
      <Grid>

        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <Button Content="Back" Style="{DynamicResource BackButtonStyle}" Command="{Binding BackCommand}"/>

      </Grid>
    </Border>
    
    <!-- Displays a list of books -->
    <ListBox Grid.Row="1" ItemsSource="{Binding Books}" Style="{DynamicResource CleanListboxStyle}"
             HorizontalContentAlignment="Stretch"
             ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
  </Grid>
</UserControl>
